Integrand size = 21, antiderivative size = 138 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {1}{2} a \left (a^2-6 b^2\right ) x+\frac {b \left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {15 a^2 b \sin (c+d x)}{2 d}-\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
Time = 0.59 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3957, 2968, 3127, 3126, 3112, 3102, 2814, 3855} \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=-\frac {5 a^3 \sin (c+d x) \cos (c+d x)}{2 d}+\frac {b \left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {1}{2} a x \left (a^2-6 b^2\right )-\frac {15 a^2 b \sin (c+d x)}{2 d}+\frac {3 a \tan (c+d x) (a \cos (c+d x)+b)^2}{2 d}+\frac {\tan (c+d x) \sec (c+d x) (a \cos (c+d x)+b)^3}{2 d} \]
[In]
[Out]
Rule 2814
Rule 2968
Rule 3102
Rule 3112
Rule 3126
Rule 3127
Rule 3855
Rule 3957
Rubi steps \begin{align*} \text {integral}& = -\int (-b-a \cos (c+d x))^3 \sec (c+d x) \tan ^2(c+d x) \, dx \\ & = -\int (-b-a \cos (c+d x))^3 \left (1-\cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx \\ & = \frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int (-b-a \cos (c+d x))^2 \left (-3 a+b \cos (c+d x)+4 a \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx \\ & = \frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int (-b-a \cos (c+d x)) \left (6 a^2-b^2-5 a b \cos (c+d x)-10 a^2 \cos ^2(c+d x)\right ) \sec (c+d x) \, dx \\ & = -\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{4} \int \left (-2 b \left (6 a^2-b^2\right )-2 a \left (a^2-6 b^2\right ) \cos (c+d x)+30 a^2 b \cos ^2(c+d x)\right ) \sec (c+d x) \, dx \\ & = -\frac {15 a^2 b \sin (c+d x)}{2 d}-\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{4} \int \left (-2 b \left (6 a^2-b^2\right )-2 a \left (a^2-6 b^2\right ) \cos (c+d x)\right ) \sec (c+d x) \, dx \\ & = \frac {1}{2} a \left (a^2-6 b^2\right ) x-\frac {15 a^2 b \sin (c+d x)}{2 d}-\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \left (b \left (6 a^2-b^2\right )\right ) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} a \left (a^2-6 b^2\right ) x+\frac {b \left (6 a^2-b^2\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {15 a^2 b \sin (c+d x)}{2 d}-\frac {5 a^3 \cos (c+d x) \sin (c+d x)}{2 d}+\frac {3 a (b+a \cos (c+d x))^2 \tan (c+d x)}{2 d}+\frac {(b+a \cos (c+d x))^3 \sec (c+d x) \tan (c+d x)}{2 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(327\) vs. \(2(138)=276\).
Time = 1.20 (sec) , antiderivative size = 327, normalized size of antiderivative = 2.37 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {\sec ^2(c+d x) \left (a^3 c-6 a b^2 c+a^3 d x-6 a b^2 d x-6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\cos (2 (c+d x)) \left (a \left (a^2-6 b^2\right ) (c+d x)+\left (-6 a^2 b+b^3\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-b \left (-6 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (-3 a^2 b+2 b^3\right ) \sin (c+d x)-\frac {1}{2} a^3 \sin (2 (c+d x))+6 a b^2 \sin (2 (c+d x))-3 a^2 b \sin (3 (c+d x))-\frac {1}{4} a^3 \sin (4 (c+d x))\right )}{4 d} \]
[In]
[Out]
Time = 1.86 (sec) , antiderivative size = 128, normalized size of antiderivative = 0.93
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(128\) |
default | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )+3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )+b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(128\) |
parts | \(\frac {a^{3} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {b^{3} \left (\frac {\sin \left (d x +c \right )^{3}}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {3 a \,b^{2} \left (\tan \left (d x +c \right )-d x -c \right )}{d}+\frac {3 a^{2} b \left (-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(136\) |
parallelrisch | \(\frac {-24 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{6}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+24 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (a^{2}-\frac {b^{2}}{6}\right ) b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+4 a d x \left (a^{2}-6 b^{2}\right ) \cos \left (2 d x +2 c \right )+\left (-2 a^{3}+24 a \,b^{2}\right ) \sin \left (2 d x +2 c \right )-12 a^{2} b \sin \left (3 d x +3 c \right )-a^{3} \sin \left (4 d x +4 c \right )+\left (-12 a^{2} b +8 b^{3}\right ) \sin \left (d x +c \right )+4 a d x \left (a^{2}-6 b^{2}\right )}{8 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(197\) |
risch | \(\frac {a^{3} x}{2}-3 a \,b^{2} x +\frac {i {\mathrm e}^{2 i \left (d x +c \right )} a^{3}}{8 d}+\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b}{2 d}-\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b}{2 d}-\frac {i {\mathrm e}^{-2 i \left (d x +c \right )} a^{3}}{8 d}-\frac {i b^{2} \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-6 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) | \(236\) |
norman | \(\frac {\left (\frac {1}{2} a^{3}-3 a \,b^{2}\right ) x +\left (\frac {1}{2} a^{3}-3 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (-a^{3}+6 a \,b^{2}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\frac {\left (a^{3}-6 a^{2} b -6 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}-\frac {3 \left (a^{3}-2 a^{2} b +2 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+\frac {3 \left (a^{3}+2 a^{2} b +2 a \,b^{2}+b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-\frac {\left (a^{3}+6 a^{2} b -6 a \,b^{2}-b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {b \left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(297\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.09 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {2 \, {\left (a^{3} - 6 \, a b^{2}\right )} d x \cos \left (d x + c\right )^{2} + {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (6 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (a^{3} \cos \left (d x + c\right )^{3} + 6 \, a^{2} b \cos \left (d x + c\right )^{2} - 6 \, a b^{2} \cos \left (d x + c\right ) - b^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
\[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{3} \sin ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 129, normalized size of antiderivative = 0.93 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} - 12 \, {\left (d x + c - \tan \left (d x + c\right )\right )} a b^{2} - b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right ) - 2 \, \sin \left (d x + c\right )\right )}}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 346 vs. \(2 (126) = 252\).
Time = 0.36 (sec) , antiderivative size = 346, normalized size of antiderivative = 2.51 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {{\left (a^{3} - 6 \, a b^{2}\right )} {\left (d x + c\right )} + {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (6 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 13.88 (sec) , antiderivative size = 202, normalized size of antiderivative = 1.46 \[ \int (a+b \sec (c+d x))^3 \sin ^2(c+d x) \, dx=\frac {a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}-\frac {a^3\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}-\frac {3\,a^2\,b\,\sin \left (c+d\,x\right )}{d}-\frac {6\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {6\,a^2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,a\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]
[In]
[Out]